package com.yzyz.utils.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

import org.springframework.jdbc.core.RowMapper;

import com.yzyz.bean.route.RouteBean;

/**
 * 
 * @author David Sun
 * @Date   2010-3-28
 *
 */
public class RouteRowMapper implements RowMapper {

	@Override
	public Object mapRow(ResultSet rs, int arg1) throws SQLException {
		RouteBean r = new RouteBean();
		r.setAvailable(rs.getBoolean("available"));
		r.setContents(rs.getString("contents"));
		r.setDate(new Date(rs.getTimestamp("date").getTime()));
		r.setId(rs.getInt("id"));
		r.setName(rs.getString("name"));
		r.setPrice(rs.getString("price"));
		r.setLevel(rs.getInt("level"));
		r.setRouteGroupId(rs.getInt("routeGroupId"));
		return r;
	}

}
